package com.dao;

import com.domain.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.*;

@Repository
public interface CommentDao {

    @Select("SELECT * FROM comment WHERE travelid=#{travelid}")
    public List<Comment> findCommentsByTravelId(Integer travelid);

    @Insert("INSERT INTO comment(userid,travelid,ctext) VALUES (#{userid},#{travelid},#{ctext})")
    public Integer addOneComment(Comment comment);
}
